package workers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.concurrent.BlockingQueue;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.ibm.mq.MQQueueManager;

import workerUIs.StepFrame;
import workflow.step.ArchitectureDesignStep;
import workflow.step.ReleaseStep;
import model.Software;

public class ReleaseStepWorker extends AbstractStepSwingWorker {
	
	public ReleaseStepWorker(StepFrame frame, String inputQueueName,
			String outputQueueName) {
		super(frame, inputQueueName, outputQueueName);
	}
	
	@Override
	protected void doStep(Software software) {		
		new ReleaseStep().doStep(software);
	}
	

	
	public static void main(String[] args)
	{
		Logger logger = Logger.getLogger(ReleaseStepWorker.class.getCanonicalName());
		
		try
		{			
			final StepFrame releaseFrame = new StepFrame("Step5: Release", 400, 600);								
			
			releaseFrame.getNextButton().addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					new ReleaseStepWorker(releaseFrame, IMQConstants.RELEASE_INPUT, null).execute();
				}
			});
			new QueueDepthObserver().observeQueueDepth(releaseFrame, IMQConstants.RELEASE_INPUT);
		}
		catch (Exception e)
		{
			logger.log(Level.SEVERE, "Error during initialization: ", e);
		}
	}

}
